#include "Formulas2D.h"

float Classify(vector2f p, vector2f p1, vector2f p2)
{
    return (p2.X - p1.X) * (p.Y - p1.Y) - (p.X - p1.X) * (p2.Y - p1.Y);
}

bool IsPointInRange( vector2f point, vector2f p1, vector2f p2, vector2f p3 )
{
	float c1 = Classify ( point, p1, p2 );
    float c2 = Classify ( point, p2, p3 );
    float c3 = Classify ( point, p3, p1 );

    return ((c1 > 0 && c2 > 0 && c3 > 0) || (c1 < 0 && c2 < 0 && c3 < 0)) ? 1 : 0;
}
